Add option to format span name with context#29
Add option to format span name with context#29vearutop wants to merge 1 commit intoopencensus-integrations:masterfrom
Conversation
|
Have you considered using local spans instead? the idea of injecting alternate names for ocsql to use through context seems both tedious and error prone. With local spans you can create a parent span around all database operations / transactions that you want to identify as a particular business logic operation. |
|
Yes, I was thinking of local spans, but that seemed extra verbose and less useful. Generally I want to span only external communications (db calls, http client requests, event publishing, etc...) because internal calculations usually are of much less latency magnitude. That's why Higher level business task may or may not invoke db call (can be short-circuited with cache), so if I create a span on parent business task I'll have a bunch of spans that are not relevant to db observability. They are not useful to me. If I create span just before calling db I would need an abstraction (that understands current business context) to use instead of direct I'm using |
de664d7 to
42810e8
Compare
This PR adds option to format span name with
func(ctx context.Context, baseName string) string.That can be handy to make spans more relevant to application flow and enable precise tracing.
Somewhat similar approach is used in
ochttp.Handler: